package woniuxy.test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.core.io.PathResource;
import org.springframework.core.io.Resource;
import woniuxy.entity.Person;

import java.io.FileInputStream;
import java.io.IOException;

/**
 * @ClassName com.woniuxy.test.test
 * @Description TODO
 * @Author LI.hh
 * @Date 2022/8/17 15:14
 * @Version 1.0
 */
public class test {
    public static void main(String[] args) {
        BeanFactory factory = new XmlBeanFactory(new PathResource("E:\\javagit\\SpringDemo01\\day02\\src\\woniuxy\\test\\applicationContext.xml"));
        Person chinese1 = (Person) factory.getBean("chineseSing");
        Person chinese2 = (Person) factory.getBean("chineseSing");
        System.out.println(chinese1 == chinese2);
        Person chinese3 = (Person) factory.getBean("chinesePro");
        Person chinese4 = (Person) factory.getBean("chinesePro");
        System.out.println(chinese3 == chinese4);
    }
}
